home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat5 / acpp.z / acpp
Encoding:
Text File  |  1998-10-30  |  21.6 KB  |  461 lines

  1.  
  2.  
  3.  
  4. AAAACCCCPPPPPPPP((((5555))))                                                                AAAACCCCPPPPPPPP((((5555))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      acpp - the ANSI C language preprocessor
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.      The ANSI C language preprocessor, _a_c_p_p, is invoked as the first pass of
  13.      any ANSI C compilation when the _c_c(1) command is issued with the ----aaaaccccpppppppp or
  14.      ----oooollllddddccccpppppppp option.  Thus, _a_c_p_p'_s output is designed to be in a form
  15.      acceptable as input to the next pass of the C compiler.  The use of the
  16.      _a_c_p_p command is not recommended, since the functionality of _a_c_p_p has been
  17.      moved into the C front-end and _a_c_p_p may not be supported in future
  18.      releases. See _m_4(1) for a general macro processor.
  19.  
  20.      This preprocessor is a version of GNU cpp.  To see which version, use
  21.      _a_c_p_p -_v.  The source code to the preprocessor is distributed in 4Dgifts.
  22.  
  23.      This is intended only as a general statement of the preprocessor's
  24.      capabilities.  For a more precise statement, see the C language standard
  25.      (reference cited at the end of this manual page).
  26.  
  27.      The following _o_p_t_i_o_n_s are recognized directly by _a_c_p_p:
  28.  
  29.  
  30.      ----PPPP      Preprocess the input without producing the line control
  31.              information used by the next pass of the C compiler.  The
  32.              compiler driver, _c_c defines appropriate symbols.
  33.  
  34.      ----DDDD_n_a_m_e
  35.  
  36.      ----DDDD_n_a_m_e=_d_e_f
  37.              Define _n_a_m_e with value _d_e_f as if by a ####ddddeeeeffffiiiinnnneeee.  If no =_d_e_f is
  38.              given, _n_a_m_e is defined with value 1.  The ----DDDD option has lower
  39.              precedence than the ----UUUU option.  That is, if the same name is used
  40.              in both a ----UUUU options and a ----DDDD option, the name will be undefined
  41.              regardless of the order of the options.
  42.  
  43.      ----IIII_d_i_r   Change the algorithm for searching for ####iiiinnnncccclllluuuuddddeeee files whose names
  44.              do not begin with / to look in _d_i_r before looking in the
  45.              directories on the standard list.  Thus ####iiiinnnncccclllluuuuddddeeee files whose
  46.              names are enclosed in "" will be searched for first in the
  47.              directory of the file with the ####iiiinnnncccclllluuuuddddeeee line, then in the
  48.              directories named in ----IIII options, and last in directories on a
  49.              standard list.  For ####iiiinnnncccclllluuuuddddeeee files whose names are enclosed in
  50.              <>, the directory of the file with the ####iiiinnnncccclllluuuuddddeeee line is not
  51.              searched.  If ----IIII is given with no _d_i_r, _a_c_p_p is instructed to
  52.              suppress the search of the standard list of include directories
  53.              (this form is obsolete, use ----nnnnoooossssttttddddiiiinnnncccc instead)).  This standard
  54.              list consists only of /_u_s_r/_i_n_c_l_u_d_e.
  55.  
  56.      ----UUUU_n_a_m_e  undefines _n_a_m_e, which is only useful if _n_a_m_e is defined via ----DDDD or
  57.              is a predefined name.  The order of the ----DDDD and ----UUUU options is not
  58.              significant: the undefines are done after all the ----DDDD's and
  59.              predefines are applied.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. AAAACCCCPPPPPPPP((((5555))))                                                                AAAACCCCPPPPPPPP((((5555))))
  71.  
  72.  
  73.  
  74.      ----ppppeeeeddddaaaannnnttttiiiicccc
  75.              All AAAANNNNSSSSIIII constraints are obeyed when this is supplied.  Howver,
  76.              only one ####eeeellllsssseeee, or ####eeeennnnddddiiiiffff  with extra tokens after the name is
  77.              reported per included file to reduce the number of error reports
  78.              on older header files.
  79.  
  80.      ----ttttrrrraaaaddddiiiittttiiiioooonnnnaaaallll
  81.              Allows dollar($) in identifiers and makes _a_c_p_p behave like a
  82.              traditional C preprocessor as defined in _T_h_e _C _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l.
  83.  
  84.      ----MMMM      The names of directly included files are printed on standard
  85.              output.
  86.  
  87.      ----CCCC      Comments are retained in the output of _a_c_p_p.
  88.  
  89.      ----nnnnoooossssttttddddiiiinnnncccc
  90.              The standard places are not searched for include files.  Use ----IIII
  91.              to specify directories to search.
  92.  
  93.  
  94.      Ordinarily, only options mentioned on the _c_c(1) man page are of interest.
  95.      However _a_c_p_p has the following options not recognized by _c_c which can be
  96.      applied with  the _c_c flag prefix ----WWWWpppp,,,,.  For example, to apply the
  97.      _a_c_p_p-only option ----WWWWaaaallllllll, use cccccccc ----WWWWpppp,,,,----WWWWaaaallllllll.
  98.  
  99.  
  100.      ----pppp   All AAAANNNNSSSSIIII CCCC constraints are obeyed.  If supplied twice, ####iiiiddddeeeennnntttt
  101.           preprocessing directives produce a warning.  Any option starting
  102.           with -p is considered to mean -pedantic (see above).
  103.  
  104.      ----oooo _o_u_t__f_n_a_m_e
  105.           The output is written to _o_u_t__f_n_a_m_e instead of stdout.
  106.  
  107.      ----ttttrrrraaaaddddiiiittttiiiioooonnnnaaaallll
  108.           Allows dollar($) in identifiers and makes _a_c_p_p behave like a
  109.           traditional C preprocessor as defined in Kernighan & Ritchie, First
  110.           Edition.
  111.  
  112.      ----ttttrrrriiiiggggrrrraaaapppphhhhssss
  113.           Turns on processing of trigraphs.
  114.  
  115.      ----BBBB   Means there is a different, longer, list of default directories to
  116.           search. And C++   // is understood as a introducing a comment.
  117.  
  118.      ----++++   Means there is a different, longer, list of default directories to
  119.           search. And C++   // is understood as a introducing a comment.
  120.  
  121.      ----WWWWttttrrrriiiiggggrrrraaaapppphhhhssss
  122.           Warns if any trigraphs are encountered in the text.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. AAAACCCCPPPPPPPP((((5555))))                                                                AAAACCCCPPPPPPPP((((5555))))
  137.  
  138.  
  139.  
  140.      ----WWWWccccoooommmmmmmmeeeennnnttttssss
  141.           Warns if a comment start is found within a comment.
  142.  
  143.      ----WWWWccccoooommmmmmmmeeeennnntttt
  144.           Warns if a comment start is found within a comment.
  145.  
  146.      ----WWWWaaaallllllll
  147.           is the same as having both ----WWWWttttrrrriiiiggggrrrraaaapppphhhhssss and ----WWWWccccoooommmmmmmmeeeennnnttttssss.
  148.  
  149.      ----MMMM   The names of directly included files are printed on standard output.
  150.  
  151.      ----MMMMMMMM  The names of included files at all nesting levels are printed on
  152.           standard output.
  153.  
  154.      ----dddd   Instead of writing the preprocessed file out, write the names and
  155.           values of all preprocessor macros defined.
  156.  
  157.      ----vvvv   prints the GNU CPP version number.
  158.  
  159.      ----CCCC   Comments are retained in the output of _a_c_p_p.
  160.  
  161.      ----$$$$   Dollar signs are allowed in identifiers.
  162.  
  163.      ----nnnnoooosssspppplllliiiicccceeee
  164.           Turn backslash newline into newline when outputting defines, but
  165.           don't consider them to end the macro definition.
  166.  
  167.      ----nnnnoooossssttttddddiiiinnnncccc
  168.           The standard places are not searched for include files.  Use -I to
  169.           specify directories to search.
  170.  
  171.      ----uuuu   Inhibits predefinition of values. If not supplied, the names mmmmiiiippppssss
  172.           and uuuunnnniiiixxxx are predefined.  _c_c -_a_n_s_i passes -u to _a_c_p_p.
  173.  
  174.      ----wwww   Turns off warning messages.
  175.  
  176.      ----sssshhhhoooowwwwddddeeeeffffiiiinnnneeeessss
  177.           Show each #define (#undef) followed by the line number and file name
  178.           where it is appears.  The first few defines shown are the predefines
  179.           built-in to _c_p_p and passed on the command line (for these the line
  180.           number and file name are meaningless).  This facility is to assist
  181.           you in the special situation where you have a #define (#undef) and
  182.           you are having difficulty determining which source file the it is
  183.           in.  Use any standard text tool to inspect the result file.
  184.           Example:
  185.  
  186.           cc  -ansi -E -Imyincludedir -Wp,-showdefines myfile.c >myresult
  187.  
  188.  
  189.      ----    As a file name, ---- is treated as a file name (stdin or stdout).
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. AAAACCCCPPPPPPPP((((5555))))                                                                AAAACCCCPPPPPPPP((((5555))))
  203.  
  204.  
  205.  
  206.      Some special names are understood by _a_c_p_p.  The name ________LLLLIIIINNNNEEEE________ is defined
  207.      as the current line number (as a decimal integer) as known by _a_c_p_p, and
  208.      ________FFFFIIIILLLLEEEE________ is defined as the current file name (as a C string) as known by
  209.      _a_c_p_p.  The name ________DDDDAAAATTTTEEEE________ is defined as the date of translation of the
  210.      source file (a character string literal of the form the names of the
  211.      months are the same as those generated by the _a_s_c_t_i_m_e(3) function, and
  212.      the first character of dd is a space character if the value is less than
  213.      10).  The name ________TTTTIIIIMMMMEEEE________ is defined as the time of translation of the
  214.      source file (a character string literal of the form generated by the
  215.      _a_s_c_t_i_m_e(3) function).  They can be used anywhere (including in macros)
  216.      just as any other defined name.
  217.  
  218.      To distinguish itself from _c_p_p(1), _a_c_p_p defines the macro ________AAAANNNNSSSSIIII____CCCCPPPPPPPP________,
  219.      setting its value to one.
  220.  
  221.      All _a_c_p_p directive lines start with any number of blanks and tabs
  222.      followed by ####.  Any number of blanks and tabs are allowed between the ####
  223.      and the directive.  The directives are:
  224.  
  225.  
  226.      ####ddddeeeeffffiiiinnnneeee _n_a_m_e _t_o_k_e_n-_s_t_r_i_n_g
  227.           Replace subsequent instances of _n_a_m_e with _t_o_k_e_n-_s_t_r_i_n_g.
  228.  
  229.      ####ddddeeeeffffiiiinnnneeee _n_a_m_e( _a_r_g, ..., _a_r_g ) _t_o_k_e_n-_s_t_r_i_n_g
  230.           Notice that there can be no space between _n_a_m_e and the (.  Replace
  231.           subsequent instances of _n_a_m_e followed by a (, a list of comma-
  232.           separated sets of tokens, and a ) followed by _t_o_k_e_n-_s_t_r_i_n_g, where
  233.           each occurrence of an _a_r_g in the _t_o_k_e_n-_s_t_r_i_n_g is replaced by the
  234.           corresponding set of tokens in the comma-separated list.  When a
  235.           macro with arguments is expanded, the arguments are placed into the
  236.           expanded _t_o_k_e_n-_s_t_r_i_n_g unchanged.  After the entire _t_o_k_e_n-_s_t_r_i_n_g has
  237.           been expanded, _a_c_p_p re-starts its scan for names to expand at the
  238.           beginning of the newly created _t_o_k_e_n-_s_t_r_i_n_g.  The #### preprocessing
  239.           token turns the immediately following argument in _t_o_k_e_n-_s_t_r_i_n_g into
  240.           a string literal (i.e., enclosed in double quotes) which contains
  241.           the spelling of the argument (see the example below).  The ########
  242.           preprocessing token causes the preceeding preprocessing token to be
  243.           concatenated with the following preprocessing token into a single
  244.           preprocessing token available for further replacement.  Either or
  245.           both of the preprocessing tokens may be substituted macro arguments.
  246.           As an example of the #### and ######## operators, the sequence
  247.                #define quote(arg)  # arg
  248.                #define glue_to_b(a)     a ## b
  249.                quote(foo)
  250.                glue_to_b(b_follows_me)
  251.           creates the output
  252.                     "foo"
  253.                b_follows_meb
  254.  
  255.  
  256.  
  257.  
  258.                                                                         PPPPaaaaggggeeee 4444
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265. AAAACCCCPPPPPPPP((((5555))))                                                                AAAACCCCPPPPPPPP((((5555))))
  266.  
  267.  
  268.  
  269.      ####uuuunnnnddddeeeeffff _n_a_m_e
  270.           Cause the definition of _n_a_m_e (if any) to be forgotten from now on.
  271.           No additional tokens are permitted on the directive line after _n_a_m_e.
  272.  
  273.      ####iiiiddddeeeennnntttt "_s_t_r_i_n_g"
  274.           The _s_t_r_i_n_g and the directive are silently swallowed.  No output is
  275.           produced for this directive.
  276.  
  277.      ####pppprrrraaaaggggmmmmaaaa
  278.           The directive and whatever follows it on the line is passed to the
  279.           output in a slightly modified form which is not documented.  The
  280.           form may change in a future release.
  281.  
  282.      ####pppprrrraaaaggggmmmmaaaa oooonnnncccceeee
  283.           If this directive appears in an included file, the file will never
  284.           be included again, even if there is another ####iiiinnnncccclllluuuuddddeeee of this file.
  285.           No tokens or comments are permitted after the ``once'' keyword.
  286.           Using ####pppprrrraaaaggggmmmmaaaa oooonnnncccceeee is more efficient than using macro wrappers,
  287.           because the included file is not rescanned, but it may not be
  288.           portable to third-party preprocessors.
  289.  
  290.      ####iiiinnnncccclllluuuuddddeeee "_f_i_l_e_n_a_m_e"
  291.  
  292.      ####iiiinnnncccclllluuuuddddeeee <_f_i_l_e_n_a_m_e>
  293.           Include at this point the contents of _f_i_l_e_n_a_m_e (which will then be
  294.           run through _a_c_p_p).  When the <_f_i_l_e_n_a_m_e> notation is used, _f_i_l_e_n_a_m_e
  295.           is only searched for in the standard places.  See the ----IIII option
  296.           above for more detail.  No additional tokens are permitted on the
  297.           directive line after the final " or >.
  298.  
  299.      ####lllliiiinnnneeee _i_n_t_e_g_e_r-_c_o_n_s_t_a_n_t _f_i_l_e_n_a_m_e
  300.           Causes _a_c_p_p to generate line control information for the next pass
  301.           of the C compiler.  _I_n_t_e_g_e_r-_c_o_n_s_t_a_n_t is the line number of the next
  302.           line and _f_i_l_e_n_a_m_e is the file from which it comes.  If "_f_i_l_e_n_a_m_e" is
  303.           not given, the current file name is unchanged.  No additional tokens
  304.           are premitted on the directive line after the optional _f_i_l_e_n_a_m_e.
  305.  
  306.      ####eeeennnnddddiiiiffff
  307.           Ends a section of lines begun by a test directive (####iiiiffff,,,, ####iiiiffffddddeeeeffff, or
  308.           ####iiiiffffnnnnddddeeeeffff).  Each test directive must have a matching ####eeeennnnddddiiiiffff. No
  309.           additional tokens are permitted on the directive line.  To reduce
  310.           the volume of error reports on older header files, aaaaccccpppppppp reports only
  311.           one instance of additional tokens per included file.
  312.  
  313.      ####iiiiffffddddeeeeffff _n_a_m_e
  314.           The lines following will appear in the output if and only if _n_a_m_e
  315.           has been the subject of a previous ####ddddeeeeffffiiiinnnneeee without being the subject
  316.           of an intervening ####uuuunnnnddddeeeeffff.  No additional tokens are permitted on the
  317.           directive line after _n_a_m_e.
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.                                                                         PPPPaaaaggggeeee 5555
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331. AAAACCCCPPPPPPPP((((5555))))                                                                AAAACCCCPPPPPPPP((((5555))))
  332.  
  333.  
  334.  
  335.      ####iiiiffffnnnnddddeeeeffff _n_a_m_e
  336.           The lines following will appear in the output if and only if _n_a_m_e
  337.           has not been the subject of a previous ####ddddeeeeffffiiiinnnneeee.  No additional
  338.           tokens are permitted on the directive line after _n_a_m_e.
  339.  
  340.      ####iiiiffff _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n
  341.           Lines following will appear in the output if and only if the
  342.           _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n evaluates to non-zero.  All binary non-
  343.           assignment C operators, the ?: operator, the unary -, !, and ~
  344.           operators are all legal in _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n.  The precedence of
  345.           the operators is the same as defined by the C language. There is
  346.           also a unary operator ddddeeeeffffiiiinnnneeeedddd, which can be used in _c_o_n_s_t_a_n_t-
  347.           _e_x_p_r_e_s_s_i_o_n in these two forms: ddddeeeeffffiiiinnnneeeedddd (((( _n_a_m_e )))) or ddddeeeeffffiiiinnnneeeedddd _n_a_m_e.
  348.           This allows the utility of ####iiiiffffddddeeeeffff and ####iiiiffffnnnnddddeeeeffff in a ####iiiiffff directive.
  349.           Only these operators, integer constants, and names which are known
  350.           by _a_c_p_p should be used in _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n.  In particular, the
  351.           ssssiiiizzzzeeeeooooffff operator is not available.
  352.  
  353.           To test whether either of two symbols, _f_o_o and _f_u_m, are defined,
  354.           use:
  355.                #if defined(foo) || defined(fum)
  356.  
  357.      ####eeeelllliiiiffff _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n
  358.           This is equivalent to a #_e_l_s_e with a #_i_f expression, and is often
  359.           more convenient than a nested #_e_l_s_e #_i_f _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n  #_e_n_d_i_f
  360.           #_e_n_d_i_f.
  361.  
  362.      ####eeeellllsssseeee
  363.           The lines following will appear in the output if and only if the
  364.           preceding test directive evaluates to zero.  No additional tokens
  365.           are permitted on the directive line.  To reduce the volume of error
  366.           reports on older header files, aaaaccccpppppppp reports only one instance of
  367.           additional tokens per included file.
  368.  
  369.      The test directives and the possible ####eeeellllsssseeee directives can be nested.
  370.  
  371.  
  372.      ####eeeerrrrrrrroooorrrr _p_r_e_p_r_o_c_e_s_s_i_n_g-_t_o_k_e_n_s
  373.           The preprocessing tokens are emitted and an error is signaled to _c_c.
  374.  
  375.      ####iiiiddddeeeennnntttt
  376.           This System V directive is silently accepted and ignored unless
  377.           -_p_e_d_a_n_t_i_c is supplied twice, in which case a warning is issued for
  378.           each ####iiiiddddeeeennnntttt encountered.
  379.  
  380.      ####ssssccccccccssss
  381.           This is a BSD-only directive. Use of it is an error.
  382.  
  383. FFFFIIIILLLLEEEESSSS
  384.      standard directory list for ####iiiinnnncccclllluuuuddddeeee files,           /usr/include
  385.  
  386.  
  387.  
  388.  
  389.  
  390.                                                                         PPPPaaaaggggeeee 6666
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397. AAAACCCCPPPPPPPP((((5555))))                                                                AAAACCCCPPPPPPPP((((5555))))
  398.  
  399.  
  400.  
  401. NNNNOOOOTTTTEEEESSSS
  402.      Two often-used capabilities of the older C preprocessor _c_p_p(1) have a
  403.      different syntax in _a_c_p_p(5).  These are _e_n_c_l_o_s_i_n_g _a _m_a_c_r_o _a_r_g_u_m_e_n_t _i_n
  404.      _d_o_u_b_l_e-_q_u_o_t_e_s, and _c_o_n_c_a_t_e_n_a_t_i_n_g _t_o_k_e_n_s.  See the discussion of ####ddddeeeeffffiiiinnnneeee
  405.      for the new syntax.
  406.  
  407. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  408.      cc(1), line(1), m4(1), cpp(1)
  409.      American National Standard for Information Systems - Programming Language
  410.      - C, ANSI X3.159-1989.
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.                                                                         PPPPaaaaggggeeee 7777
  457.  
  458.  
  459.  
  460.